package com.service.impl;

import com.bean.Admin;
import com.dao.AdminDao;
import com.dao.impl.AdminDaoImpl;
import com.service.AdminService;

import java.util.List;

public class AdminServiceImpl implements AdminService {
    AdminDao adminDao =new AdminDaoImpl();
    @Override
    public List<Admin> existsadminname(String adminname) {
        return adminDao.queryAname(adminname);
    }

    @Override
    public boolean queryPanmae(String adminname, String adminpassword) {
        return (adminDao.queryAdminvname(adminname,adminpassword)!=null);
    }

    @Override
    public int deleteadminnameById(Integer id) {
        return adminDao.deleteAdminid(id);
    }

    @Override
    public int addadminn(Admin admin) {
        return adminDao.addAdmin(admin);
    }

    @Override
    public int updateAdmin(Admin admin) {
        return adminDao.updataAdmin(admin);
    }

    @Override
    public List<Admin> queryAllAdmin() {
        return adminDao.queryAdminAll();
    }


}
